package com.d3works.apps.account.db.repo;

import com.d3works.apps.account.db.Journal;

public class JournalManagementRepository extends JournalRepository {

  @Override
  public Journal copy(Journal entity, boolean deep) {

    Journal copy = super.copy(entity, deep);

    copy.setCode(String.format("%s (copy)", entity.getCode()));
    copy.setName(String.format("%s (copy)", entity.getName()));
    copy.setStatusSelect(JournalRepository.STATUS_INACTIVE);
    copy.setSequence(null);

    return copy;
  }
}
